﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Announcement/Announcement.master" AutoEventWireup="true" CodeBehind="AnnouncementList.aspx.cs" Inherits="HRdex_Final.Announcement.WebForm1" %>

<asp:Content ID="AnnouncementList" ContentPlaceHolderID="MainContent" runat="server">
  <div align="center">
    <asp:GridView ID="gvAnnouncement" runat="server" AutoGenerateColumns="False" 
    DataKeyNames="AnnouncementID" DataSourceID="dstAnnouncementList" 
        BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
        CellPadding="3" Width="639px">
    <Columns>
    <asp:TemplateField>
<ItemTemplate> 
<asp:HyperLink ID="lnkSelect" runat='server' NavigateUrl='<%# String.Format("~/Announcement/AnnouncementForm.aspx?AnnouncementID={0}", Eval("AnnouncementID")) %>'>Select</asp:HyperLink> 
</ItemTemplate> 
</asp:TemplateField>
        <asp:BoundField DataField="AnnouncementID" HeaderText="AnnouncementID" InsertVisible="False" 
            ReadOnly="True" SortExpression="AnnouncementID" Visible="False" />
        <asp:BoundField DataField="Subject" HeaderText="Subject" 
            SortExpression="Subject" />
        <asp:BoundField DataField="Published" HeaderText="Published" 
            SortExpression="Published" />
        <asp:BoundField DataField="Category" HeaderText="Category" 
            SortExpression="Category" />
    </Columns>
        <FooterStyle BackColor="White" ForeColor="#000066" />
        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
        <RowStyle ForeColor="#000066" />
        <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F1F1F1" />
        <SortedAscendingHeaderStyle BackColor="#007DBB" />
        <SortedDescendingCellStyle BackColor="#CAC9C9" />
        <SortedDescendingHeaderStyle BackColor="#00547E" />
</asp:GridView>

<asp:SqlDataSource ID="dstAnnouncementList" runat="server" 
    ConnectionString="<%$ ConnectionStrings:HRmainConnectionString %>" 
    
        SelectCommand="SELECT formAnnouncement.AnnouncementID, formAnnouncement.Subject, formAnnouncement.DateTime AS Published, catAnnouncement.CatName AS Category FROM catAnnouncement INNER JOIN formAnnouncement ON catAnnouncement.CatAnnID = formAnnouncement.CatAnnID ORDER BY formAnnouncement.AnnouncementID DeSC">
</asp:SqlDataSource>

</div>
</asp:Content>
